package com.wgts.wgts.dagger.module;

import com.wgts.wgts.dagger.scope.ActivityScope;
import com.wgts.wgts.dagger.scope.FragmentScope;
import com.wgts.wgts.mvp.model.IShoppingCarModel;
import com.wgts.wgts.mvp.model.imp.ShoppingCarModel;
import com.wgts.wgts.mvp.presenter.IShoppingCarPersenter;
import com.wgts.wgts.mvp.presenter.imp.ShoppingCarPersenter;
import com.wgts.wgts.mvp.view.IShoppingCarView;
import com.wgts.wgts.netmodle.NetService;

import dagger.Module;
import dagger.Provides;

/*
 *
 *
 *   data:2018/10/1820:24
 *
 */
@Module
public class ShopCarActivityModule {
    private IShoppingCarView view;

    public ShopCarActivityModule(IShoppingCarView view) {
        this.view = view;
    }

    @Provides
    @ActivityScope
    public IShoppingCarView provideView(){
        return view;
    }

    @Provides
    @ActivityScope
    public IShoppingCarModel provideModel(NetService netService){
        return new ShoppingCarModel(netService);
    }

    @Provides
    @ActivityScope
    public IShoppingCarPersenter providePersenter(IShoppingCarModel model, IShoppingCarView view){
        return new ShoppingCarPersenter(model, view);
    }
}
